<div class="title">
<h3>更改邮箱</h3>
<ul>
<li><a href="#" title="基本资料">基本资料</a></li>
<li><a href="#" title="修改密码">修改密码</a></li>
<li class="current"><a href="#" title="更改邮箱">更改邮箱</a></li>
</ul>
</div>

<div class="main_content">
    <?php echo CHtml::beginForm('?r=setting/email','post',array('id'=>editemail)); ?>
 
    <?php echo CHtml::errorSummary($model); ?>
    <div class="set_mail">
        <div class="set_list">
            <label for="User_old_email">原邮箱：</label><?php echo CHtml::activeTextField($model,'old_email',array('class'=>'validate',validator=>'required|email' ))?>
        </div>
        <div class="set_list">
            <label for="User_new_email">新邮箱：</label><?php echo CHtml::activeTextField($model,'new_email',array('class'=>'validate',validator=>'required|email' ))?>
        </div>
        <div class="set_list">
            <label for="User_repassword">当前密码：</label><?php echo CHtml::activePasswordField($model,'repassword',array('class'=>'validate',validator=>'required' ))?>
        </div>
        
        <div class="set_but"><?php echo CHtml::submitButton('修改',array('class'=>'validate_check')); ?></div>
    </div>
    <?php echo CHtml::endForm(); ?>
</div>
<script type="text/javascript">
$(document).ready(function(){

var options = {
beforeSubmit:function(){if(validator_status){return false;}},
     success: function(data) { 
            var msg='设置保存失败';
            switch(data){
                case '0': msg="邮箱修改成功";break;
                case '1': msg="原邮箱输入不正确";break;
                case '2': msg='密码错误，请重新输入';break;
                case '3': msg="修改失败请检查后重新操作";break;
            }

            $('#topmsg').html(msg)
            $('#showmsg').show();
            showDialog();
            setTimeout(function(){$('#showmsg').hide();},1000);
        }
};
$('#editemail').ajaxForm(options);
})
</script>